﻿<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
      Id="AG.SharePoint.Ribbon.CustomTab"
      Location="CommandUI.Ribbon" RegistrationType="List" RegistrationId="101">

    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.Tabs._children">

          <Tab Id="AG.SharePoint.Ribbon.CustomTab" Title="My First custom tab" Description=""
               Sequence="501">
            <Scaling Id="AG.SharePoint.Ribbon.CustomTab.Scaling">
              <MaxSize Id="AG.SharePoint.Ribbon.CustomTab.NotificationGroup.MaxSize"
                       GroupId="AG.SharePoint.Ribbon.CustomTab.NotificationGroup"
                       Size="OneLarge"/>
              <Scale Id="AG.SharePoint.Ribbon.CustomTab.NotificationGroup.Scaling.CustomTabScaling"
                     GroupId="AG.SharePoint.Ribbon.CustomTab.NotificationGroup"
                     Size="OneLarge" />
            </Scaling>
            <Groups Id="AG.SharePoint.Ribbon.CustomTab.Groups">

              <Group
                Id="AG.SharePoint.Ribbon.CustomTab.NotificationGroup"
                Description="Contains notification items"
                Title="Notification messages"
                Sequence="52"
                Template="Ribbon.Templates.OneLargeExample">
                <Controls Id="AG.SharePoint.Ribbon.CustomTab.NotificationGroup.Controls">

                  <Button
                    Id="AG.SharePoint.Ribbon.CustomTab.NotificationGroup.Notify"
                    Command="AG.Command.Notify"
                    Sequence="15" Image16by16="/_layouts/images/NoteBoard_16x16.png"
                    Image32by32="/_layouts/images/NoteBoard_32x32.png"
                    Description="Uses the notification area to display a message."
                    LabelText="Notify hello"
                    TemplateAlias="cust1"/>
                </Controls>
              </Group>
              <Group
                Id="AG.SharePoint.Ribbon.CustomTab.StatusGroup"
                Description="Contains 'add status' items"
                Title="Add status messages"
                Sequence="49"
                Template="Ribbon.Templates.TwoMediumExample">
                <Controls Id="AG.SharePoint.Ribbon.CustomTab.StatusGroup.Controls">
                  <Button
                   Id="AG.SharePoint.Ribbon.CustomTab.StatusGroup.AddStatusInfo"
                   Command="AG.Command.AddStatusInfo"
                   Sequence="17" Image16by16="/_layouts/images/info16by16.gif"
                   Image32by32="/_layouts/images/info16by16.gif"
                   Description="Uses the status bar to display an info message."
                   LabelText="Info status"
                   TemplateAlias="cust2"/>
                  <Button
                    Id="AG.SharePoint.Ribbon.CustomTab.StatusGroup.AddStatusWarning"
                    Command="AG.Command.AddStatusWarning"
                    Sequence="17" Image16by16="/_layouts/images/warning16by16.gif"
                    Image32by32="/_layouts/images/warning32by32.gif"
                    Description="Uses the status bar to display a warning message."
                    LabelText="Warning status"
                    TemplateAlias="cust3"/>
                </Controls>
              </Group>

            </Groups>
          </Tab>
        </CommandUIDefinition>

        <CommandUIDefinition Location="Ribbon.Templates._children">
          <GroupTemplate Id="Ribbon.Templates.OneLargeExample">
            <Layout Title="OneLarge" LayoutTitle="OneLarge">
              <Section Alignment="Top" Type="OneRow">
                <Row>
                  <ControlRef DisplayMode="Large" TemplateAlias="cust1" />
                </Row>
              </Section>
            </Layout>
          </GroupTemplate>
        </CommandUIDefinition>
        <CommandUIDefinition Location="Ribbon.Templates._children">
          <GroupTemplate Id="Ribbon.Templates.TwoMediumExample">
            <Layout Title="TwoMedium" LayoutTitle="TwoMedium">
              <Section Alignment="Top" Type="TwoRow">
                <Row>
                  <ControlRef DisplayMode="Medium" TemplateAlias="cust2" />
                </Row>
                <Row>
                  <ControlRef DisplayMode="Medium" TemplateAlias="cust3" />
                </Row>
              </Section>
            </Layout>
          </GroupTemplate>
        </CommandUIDefinition>
      </CommandUIDefinitions>

      <CommandUIHandlers>

        <CommandUIHandler
          Command="AG.Command.Notify"
          CommandAction="BLOCKED SCRIPT
         var notificationId = SP.UI.Notify.addNotification('Hello from the notification area'); 
         " />

        <CommandUIHandler
          Command="AG.Command.AddStatusInfo"
          CommandAction="BLOCKED SCRIPT
   
         var statusId = SP.UI.Status.addStatus('Quite important status message');
         latestId = statusId;
         enableRemoveStatusButton();
                     " />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>

</Elements>
